package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.LicencePlateBean;
import com.molichuxing.services.infrastructure.bean.YearlyInspectionBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 车牌表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2019-08-15
 */
public interface YearlyInspectMapper extends RootMapper<YearlyInspectionBean> {

    /**
     * 根据条件分页查询count
     *
     * @param status
     * @param carIds
     * @param inspectStartDate
     * @param inspectEndDate
     * @return
     */
    public int getYearlyInspectPageCount(@Param("status") int status, @Param("carIds") List<Integer> carIds,
                                         @Param("inspectStartDate") String inspectStartDate, @Param("inspectEndDate") String inspectEndDate,@Param("handleStatus") Integer handleStatus);

    /**
     * 根据状态分页查询count
     *
     * @param status
     * @return
     */
    public int getYearlyInspectCount(@Param("status") int status);

    /**
     * 根据条件分页查询集合
     *
     * @param status
     * @param carIds
     * @param inspectStartDate
     * @param inspectEndDate
     * @param pageNum
     * @param pageSize
     * @return
     */
    public List<YearlyInspectionBean> getYearlyInspectPage(@Param("status") int status, @Param("carIds") List<Integer> carIds,
                                                           @Param("inspectStartDate") String inspectStartDate, @Param("inspectEndDate") String inspectEndDate,@Param("handleStatus") Integer handleStatus, @Param("sortName") String sortName, @Param("sortWay") String sortWay, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    /**
     * 根据车辆id获取车牌信息
     *
     * @param carId
     * @return
     */
    @Override
    public YearlyInspectionBean getById(@Param("carId") Integer carId);

    /**
     * 新增年检信息
     *
     * @param yearlyInspectionBean
     * @return
     */
    @Override
    public int create(YearlyInspectionBean yearlyInspectionBean);

    /**
     * 编辑年检信息
     *
     * @param yearlyInspectionBean
     * @return
     */
    public int modify(YearlyInspectionBean yearlyInspectionBean);

    /**
     * 年检导出
     * @param status
     * @param carIds
     * @param inspectStartDate
     * @param inspectEndDate
     * @return
     */
    public List<YearlyInspectionBean> getYearlyInspectList(@Param("inspectionIdList") List<String> inspectionIdList,@Param("status") int status, @Param("carIds") List<Integer> carIds,
                                                           @Param("inspectStartDate") String inspectStartDate, @Param("inspectEndDate") String inspectEndDate);

    public long getYearlyInspectDownloadCount(@Param("inspectionIdList") List<String> inspectionIdList,@Param("status") int status, @Param("carIds") List<Integer> carIds,
                                                           @Param("inspectStartDate") String inspectStartDate, @Param("inspectEndDate") String inspectEndDate);

    public List<Integer> getCarIdListByHandleStatus(@Param("handleStatus") int handleStatus);

    public int modifyBatch(List<YearlyInspectionBean> yearlyInspectionList);

    public int modifyYearlyInspection(@Param("carIdList") List<Integer> carIdList);

    public List<YearlyInspectionBean> getListByCarId(@Param("carIdList") List<Integer> carIdList);

    public int modifyYearlyInspectionHandleStatus();
}
